import request from '@/utils/request.js'
// 注册接口
export const userRegister = ({ username, password, repassword }) => {
  return request.post('/api/reg', {
    username,
    password,
    repassword
  })
}

export const userLogin = ({ username, password }) =>
  request.post('/api/login', { username, password })

export const userInfo = () => request.get('/my/userinfo')

export const updateUserInfo = (obj) => request.put('/my/userinfo', obj)

export const updateAvatar = (avatar) =>
  request.patch('/my/update/avatar', { avatar })

export const updatePassword = (obj) => request.patch('/my/updatepwd', obj)
